package com.app.miwawa.api.system.entity.center;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.framework.common.api.entity.CommonEntityUUID;

/**
 * 系统管理－关联表
 * <p>描述: </p>
 * <p>Company: Professional</p>
 * @author chanlong(陈龙)
 * @date 2016年2月7日 下午3:03:58
 * @version 1.0.2016
 */
@Entity @Table(name = "TB_SYSTEM_RELATION")
public class Relation extends CommonEntityUUID {

	/** serialVersionUID(long):. */
	private static final long serialVersionUID = -6697572442548678037L;
	
	// 关联表（user、...）
	@Column(name = "target", length = 50, nullable = true)
	private String target;
	
	// 关联表ID
	@Column(name = "target_id", length = 50, nullable = true)
	private String targetid;
	
	// 主表（dept、...）
	@Column(name = "source", length = 50, nullable = true)
	private String source;
		
	// 主表ID
	@Column(name = "source_id", length = 50, nullable = true)
	private String sourceid;
	
	@Transient
	private Depts depts;
	
	@Transient
	private Users users;
	
	public Relation() {
		
	}
	
	public Relation(String target, String targetid, String source, String sourceid) {
		this.target = target;
		this.targetid = targetid;
		this.source = source;
		this.sourceid = sourceid;
	}

	public String getTarget() {
		return target;
	}

	public void setTarget(String target) {
		this.target = target;
	}

	public String getTargetid() {
		return targetid;
	}

	public void setTargetid(String targetid) {
		this.targetid = targetid;
	}

	public String getSource() {
		return source;
	}

	public void setSource(String source) {
		this.source = source;
	}

	public String getSourceid() {
		return sourceid;
	}

	public void setSourceid(String sourceid) {
		this.sourceid = sourceid;
	}

	public Depts getDepts() {
		return depts;
	}

	public void setDepts(Depts depts) {
		this.depts = depts;
	}

	public Users getUsers() {
		return users;
	}

	public void setUsers(Users users) {
		this.users = users;
	}

}
